﻿using Cms.Core.Application.Service.TokenInfo;
using Cms.Core.Infrastructure.Dependency;
using Cms.Core.Infrastructure.Ui;
using System;
using System.Collections.Generic;
using System.Security.Claims;
using System.Text;
using System.Threading.Tasks;

namespace Cms.Core.Application.IService.TokenInfo
{
    /// <summary>
    /// Token
    /// </summary>
    public interface ITokenService : ITransientDependency
    {

        /// <summary>
        /// 异步保存Token
        /// </summary>
        /// <param name="input"></param>
        /// <param name="claims"></param>
        /// <returns></returns>
        Task<OperationResult> SaveTokenAsync(TokenDto input, IEnumerable<Claim> claims);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        Task<TokenDto> GetToken(string token);

        /// <summary>
        /// 判断是否过期
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        Task<bool> IsTokenExpiredAsync(string token);


        /// <summary>
        /// 异步设置token状态
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        Task<OperationResult> SetTokenStateAsync(string token);

    }
}
